# -*- coding: utf-8 -*-
# @Author : y
# @Date   : 2021/6/15
# @File   : EG57_EntNameChangeList.py
# @E-mail : yantao@bbdservice.com

'''eof
name:申请企业曾用名清单
code:EG57_EntNameChangeList
tableName:
columnName:
groups:企业通用模块
dependencies:EG_CASE_DSJ
type:常用指标
datasourceType:在线指标
description:
eof'''

# return basicList企业照面信息中曾用名（enterpriseHisName）字段原值

import sys
import pandas as pd
import json
from datetime import datetime

null_type_list = ['', ' ', None, 'null', 'Null', 'NULL', '/', '-', '--', []]

def EG57_EntNameChangeList():
    try:
        EG_DSJ_1 = EG_CASE_DSJ.get('data')
        EG = EG_DSJ_1.get('R1160', '')[0]
        if EG == '':
            return '缺失值'
        else:
            factor = []
            hisNameList = EG.get('hisNameList', '')
            for i in hisNameList:
                if i == '':
                    pass
                else:
                    enterpriseHisName = i.get('hisName', '')
                    if enterpriseHisName not in null_type_list:
                        factor.append(enterpriseHisName)
                    else:
                        pass
            return {'hisNameList': factor}
    except:
        return '缺失值'

result = EG57_EntNameChangeList()